import * as actionTypes from '../../contents/life/clean'

const initialState = [];

export default function clean(state = initialState, action) {
	switch (action.type) {
		case actionTypes.UPDATE_CLEAN:
			return state = action.data;
		case actionTypes.ADD_CLEAN:
			 state.unshift(action.data);
       return state
		case actionTypes.DELETE_CLEAN:
      return state.filter(item => {
        if(item.id !== action.data.id){
          return item
        }
      })
		default:
			return state;
	}
}
